package org.example.system.service;

import org.example.system.entity.Comment;
import org.example.system.mapper.CommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class CommentService {
    @Autowired
    private CommentMapper commentMapper;

    public List<Comment> findAll() {
        return commentMapper.selectAll();
    }
    public int add(Comment comment) {
        return commentMapper.insert(comment);
    }
    public int update(Comment comment) {
        return commentMapper.update(comment);
    }
    public int delete(Long id) {
        return commentMapper.deleteById(id);
    }
} 